<?php
if (!defined('__COLA_DIR__')) exit;
/**
 * 最新文章
 *
 * @author edikud
 * @package Widget
 * @copyright Copyright (c) 2019 Cola (http://www.mcooo.com)
 * @license GNU General Public License 2.0
 */
class Widget_Contents_Post_Recent extends Widget_Abstract_Contents
{
    /**
     * 执行函数
     *
     * @access public
     * @return void
     */
    public function execute()
    {
        $this->parameter->setDefault(array('pageSize' => $this->options->postsListSize));

        $this->select()
        ->where('table.contents.type = ?', 'post')
        ->limit($this->parameter->pageSize)
		->order('table.contents.cid', 'DESC')
		->fetchAll(array($this, 'push'));
    }
}
